package com.zhangyj.impl.component.grid.render;

import java.io.IOException;
import java.io.Writer;

import com.zhangyj.component.grid.HTMLTable;
import com.zhangyj.component.grid.render.ICellRender;
import com.zhangyj.util.Tools;

public class DefaultStringCellRender implements ICellRender {

	
	public void writer(HTMLTable table, Writer writer, Object value, boolean isSelected, boolean hasFocus, int column) throws IOException {
		writer.append("<td>");
		if (value != null) {
			if (value instanceof String )
				writer.append(Tools.htmlEncode(value.toString()));
			else {
				writer.append(value.toString());
			}
		}
		writer.append("</td>");
	}
}